#include "botdriver.h"

void PlayVoiceCMD(wstring filename){
	wstring path=L"flashsound/";	
	path=path.append(filename);
	PlaySound(path.c_str(), NULL, SND_FILENAME |SND_NODEFAULT);
}

void Forward(double num){
	PlayVoiceCMD(L"forward.wav");
	Sleep(MS_PER_GRID_NORMAL*num);
	PlayVoiceCMD(L"stop.wav");
}

void Back(double num){
	PlayVoiceCMD(L"back.wav");
	Sleep(MS_PER_GRID_NORMAL*num);
	PlayVoiceCMD(L"stop.wav");

}

void TurnRight(double num){
	PlayVoiceCMD(L"right.wav");
	Sleep(MS_PER_90DEGREE*num);
	PlayVoiceCMD(L"stop.wav");
}

void TurnLeft(double num){
	PlayVoiceCMD(L"left.wav");
	Sleep((MS_PER_90DEGREE)*num);
	PlayVoiceCMD(L"stop.wav");
}



void Stop(){
	PlayVoiceCMD(L"stop.wav");
}

void Open(){
	PlayVoiceCMD(L"open.wav");
	Sleep((MS_PER_GRAB));
	PlayVoiceCMD(L"stop.wav");
}

void Close(){
	PlayVoiceCMD(L"close.wav");
	Sleep((MS_PER_GRAB));
	PlayVoiceCMD(L"stop.wav");
}

void Up(){
	PlayVoiceCMD(L"up.wav");
	Sleep((MS_PER_GRAB));
	PlayVoiceCMD(L"stop.wav");
}

void Down(){
	PlayVoiceCMD(L"down.wav");
	Sleep((MS_PER_GRAB));
	PlayVoiceCMD(L"stop.wav");
}